module.service('Member', ['$rootScope', function ($rootScope) {
    var service = {
        _baseUrl: "/azeroth/back/login/",
        adminMemberList: [],
        memberList: [],
        totalSceneCount: 0,
        queryAdminList: function (currentPage, pageSize, callback) {

            var paramData = {};
            $rootScope.ajaxRequestPost(service._baseUrl + "getAdminList.htm", paramData, function (resultJson) {
                angular.copy(resultJson.data, service.adminMemberList);
                if (callback) {
                    callback();
                }
            });
        },
        queryMemberList: function (member, callback) {

            $rootScope.ajaxRequestPost("/azeroth/back/member/getMemberList.htm", member, function (resultJson) {
                angular.copy(resultJson.data, service.memberList);
                if (callback) {
                    callback();
                }
            });
        },
        findLowMem: function (memberId, callback) {
            var param = {
                inviteMemberId: memberId
            };

            $rootScope.ajaxRequestPost("/azeroth/back/member/getMemberList.htm", param, function (resultJson) {
                angular.copy(resultJson.data, service.memberList);
                if (callback) {
                    callback();
                }
            });
        },
        pcRegister: function (member, callback) {

            $rootScope.ajaxRequestPost(service._baseUrl + "pcRegister.htm", member, function (resultJson) {

                if (callback) {
                    callback();
                }
            });
        },
        deleteMem: function (member, callback) {

            $rootScope.ajaxRequestPost(service._baseUrl + "deleteAdmin.htm", member, function (resultJson) {

                if (callback) {
                    callback();
                }
            });
        }

    };
    return service;
}]);
